﻿@{
    Layout = null;
}
@model LY.Manage.Model.DemoInfo

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ShowAddInfo</title>
    <link href="~/plugins/layui/css/layui.css" rel="stylesheet" />

    <script src="~/plugins/layui/layui.js"></script>
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script src="~/Scripts/lyUtils.js"></script>
    <script type="text/javascript">
       
        $(function () {
            console.log(getUrlParam("id"));
            $('#id').val(getUrlParam("id"));
        });

      
    </script>

</head>
<body>
    <form class="layui-form" action="/DemoInfo/EditInfo" id="fmMain" method="post">
        <input type="hidden" id="id" name="id" />
        <div class="layui-form-item">
        </div>

        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" lay-verify="name" value="@Model.name" autocomplete="off" placeholder="请输入姓名" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">Email</label>
                <div class="layui-input-inline">
                    <input type="text" name="email" lay-verify="email" value="@Model.email" placeholder="请输入Email" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-inline">
                    @if(@Model.sex=="男")
                    {
                          <input type="radio" name="sex" value="男" title="男" checked >
                         <input type="radio" name="sex" value="女" title="女">
                    }else
                    {
                         <input type="radio" name="sex" value="男" title="男"  >
                   <input type="radio" name="sex" value="女" title="女" checked>
                    }
                  
                   

                </div>
            </div>

        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">年龄</label>
                <div class="layui-input-inline">
                    <input type="text" name="age" lay-verify="number" value="@Model.age" autocomplete="off" placeholder="请输入年龄" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">出生日期</label>
                <div class="layui-input-inline">
                    <input type="text" name="birthday" id="birthday" value="@Model.birthday" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">

                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">时间选择器</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="time" id="time" placeholder="HH:mm:ss">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">部门</label>
                <div class="layui-input-inline">
                    @*@Html.DropDownList("DepName", ViewBag.DevNameList as IEnumerable<SelectListItem>)*@
                  
                    @Html.DropDownListFor(model => model.depid, ViewBag.DevNameList as IEnumerable<SelectListItem>, new { @class = "form-control" })
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <label class="layui-form-label">启用-默认是</label>
                    <div class="layui-input-block">
                     
                        <input type="checkbox" checked="" name="isenable" id="isenable" lay-skin="switch" lay-filter="switchTest" lay-text="是|否" value="@Model.isenable">


                    </div>
                </div>
            </div>
        </div>



        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>





    <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    <script>
        layui.use(['form', 'layedit', 'laydate'], function () {
            var form = layui.form,
                layer = layui.layer,
                layedit = layui.layedit,
                laydate = layui.laydate;

            //日期
            laydate.render({
                elem: '#birthday',

            });
            laydate.render({
                elem: '#time',
                type: 'time'

            });


            //创建一个编辑器
            var editIndex = layedit.build('LAY_demo_editor');

            //自定义验证规则
            form.verify({
                //title: function (value) {
                //    if (value.length < 5) {
                //        return '标题至少得5个字符啊';
                //    }
                //},
                //pass: [/(.+){6,12}$/, '密码必须6到12位'],
                //content: function (value) {
                //    layedit.sync(editIndex);
                //}
            });


            //监听提交
            //form.on('submit(demo1)', function (data) {
            //    //layer.alert(JSON.stringify(data.field), {
            //    //    title: '最终的提交信息'




            //    //})
            //    return false;
            //});


        });
    </script>

</body>

</html>
